<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.db.conn"%>
<%@ page import="java.sql.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
<jsp:include flush="true" page="${basePath}/admin/head.jsp"></jsp:include>
<link rel="stylesheet" href="<%=path %>/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="<%=path %>/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=path %>/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="<%=path %>/kindeditor/lang/zh_CN.js"></script>
<script charset="utf-8" src="<%=path %>/kindeditor/plugins/code/prettify.js"></script>
<script>
    KindEditor.ready(function(K) {
        var editor1 = K.create('textarea[name="Textarea1"]', {
            cssPath : '<%=path %>/kindeditor/plugins/code/prettify.css',
            uploadJson : '<%=path %>/kindeditor/jsp/upload_json.jsp',
            fileManagerJson : '<%=path %>/kindeditor/jsp/file_manager_json.jsp',
            allowFileManager : true,
            afterCreate : function() {
                var self = this;
                K.ctrl(document, 13, function() {
                    self.sync();
                    document.forms['example'].submit();
                });
                K.ctrl(self.edit.doc, 13, function() {
                    self.sync();
                    document.forms['example'].submit();
                });
            }
        });
        prettyPrint();
    });
</script>

<script src="<%=path %>/admin/js/jquery.js" type="text/javascript"></script>
<script src="<%=path %>/admin/js/formValidator.js" type="text/javascript"></script>  
<script src="<%=path %>/admin/js/formValidatorRegex.js" type="text/javascript"></script>
<link href="<%=path %>/admin/css/validator.css" rel="stylesheet" type="text/css" />



 </head>

 <body class="ms-body ms-aside-left-open ms-primary-theme ms-has-quickbar">
    <!-- Body Content Wrapper -->
    <div class="ms-content-wrapper">
        <div class="row">
            <div class="col-md-12">
                   <div class="ms-panel">
        <div class="ms-panel-header ms-panel-custome">
            <h6>编辑章节信息</h6>
        </div>
        <div class="ms-panel-body">
            <div class="table-responsive">
                <table id="data-table10" class="table w-100 thead-primary">
                    <tr>
                        <td>
						<form  action="<%=path %>/bmore_Edit" method="post">
		 <table style="width:100%;" id="ctl001">
        <% 			conn cn=new conn();
    
     			String id = request.getParameter("id");
				String sql = "select * from bmore where mid=" + id ;
				ResultSet rs = cn.query(sql);
				rs.next();
			%>
<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>小说ID:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_bid" type="text" id="txt_bid" style="width: 200px; "  value='<%= rs.getString("bid") %>' /></div><div id="txt_bidTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>

<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>章节名称:</td>
<td class="tbright"><div style="display:inline;float:left;">
<input name="txt_mtitle" type="text" id="txt_mtitle" style="width: 200px; "  value='<%= rs.getString("mtitle") %>' /></div><div id="txt_mtitleTip" style="width:250px;display:inline;float:left;text-align:left;"></div>
 </td></tr>

<tr>
<td  style=" text-align:right; width:20%;"><font style='color:red'>*&nbsp;</font>章节内容:</td>
<td class="tbright"><div style="display:inline;float:left;">
<textarea id="Textarea1"  name="Textarea1"  cols="100" rows="8" style="width:700px;height:400px;visibility:hidden;"><%= rs.getString("memo") %></textarea></div>
 </td></tr>



    <tr>
        <td>&nbsp;</td>
        <td align="left">
	    <input name="id" type="hidden" id="id" value='<%= request.getParameter("id") %>'> 
        <input type="submit" name="btnAdd" value="编 辑" onclick="return jQuery.formValidator.PageIsValid('1');" id="btnAdd"  class="btn"  />
    <input name="btnReturn" type="button" value="返 回"  class="btn"  onclick="location.href='<%=path %>/admin/bmore/bmore_Manage.jsp';"  />
            </td>
    </tr>
</table>
	<%
				if (rs != null)
					rs.close();
				if (cn != null)
					cn.close();
			%>
           </form>
	<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $.formValidator.initConfig({ onError: function(msg) { alert(msg) } });
        $("#txt_bid").formValidator({empty:false,onshow:"请输入小说ID",onfocus:"只能输入数字",oncorrect:"合法"}).RegexValidator({regexp:"num",datatype:"enum",onerror:"只能为数字"});
        $("#txt_mtitle").formValidator({ onshow: "请输入章节名称", onfocus: "章节名称不能为空", oncorrect: "合法" }).InputValidator({ min: 1, onerror: "章节名称不能为空,请确认" });
    });
</script>


                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

            </div>
        </div>
    </div>

</body>
</html>

